<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body>
    <h1>首页</h1>
    请输入商品名称:<input type="text" id="msg">
    <button onclick="doBuy()">Buy</button><br/>
    <div id="divMsg"></div>
    <script>
        function doBuy() {
            var msg = document.getElementById("msg").value;
            axios({
                url:"http://localhost:9000/provider/echo/"+msg,
                method:"get",
            }).then(function(response){
                alert(response.data);
                document.getElementById("divMsg").innerText=response.data;
            })

        }
    </script>
</body>
</html>